﻿using System;
using System.Collections.Generic;
using System.Text;
using TTClassLibrary;
using TTServer.Messages;
using libCommonClass;
using TTServer.Controller;
using libAsymmetricEncryption;
using libUtilities;

namespace TTServer.MessageProcessor
{
    public class SignOutRequestMessageProcessor : IMessageProcessor
    {
        public bool Process(libCommonClass.TTMessage message, libInterface.IClientInfoProvider clientInfoProvider)
        {
            if (message is SignOutRequestMessage)
            {
                SignOutRequestMessage msg = (SignOutRequestMessage)message;

                clientInfoProvider.TemporaryKey = "";
                clientInfoProvider.Authority = AuthorityConstant.GUEST;

                SignOutResponseMessage responseMSG = new SignOutResponseMessage(true, "");

                clientInfoProvider.AddToMessageQueue(responseMSG);

                return true;
            }

            return false;
        }
    }
}
